var IT = {
		
	test_img : new CGL.image.Image(),
	zoom_img : new CGL.image.Image(),
	zoom_img2 : new CGL.image.Image(),
	zoom_max : 8,
	zoom_min : 1,
	zoomin : true,
	zoom : 1,
	zoom_step : 0.1,
	
	init : function() {
		CGL.canvas.createCanvas("canvas", 640, 480);
		CGL.event.initEventHandler();
		setInterval(IT.update, 1000/CGL.canvas.TARGET_FPS);
		
		IT.test_img.load("img/testimg.png");
	},
	
	update : function() {
		IT.render();
		if(CGL.resources.getFinishedLoading())
		{
			if(IT.zoomin)
			{
				IT.zoom += IT.zoom_step;
				if(IT.zoom > IT.zoom_max)
				{
					IT.zoomin = false;
				}
			}
			else
			{
				IT.zoom -= IT.zoom_step;
				if(IT.zoom < IT.zoom_min)
				{
					IT.zoomin = true;
				}
			}
		}
		IT.zoom_img = CGL.image.nearestNeighbor(IT.test_img, IT.zoom);
	},
	
	render : function() {
		ctx = CGL.canvas.getContext();
		ctx.clearRect(0, 0, 640, 480);
		
		ctx.fillStyle = "black";
		CGL.util.showFps(ctx, 10, 10);
		
		if(CGL.resources.getFinishedLoading())
		{
			IT.test_img.render(ctx, 200, 200);

			IT.zoom_img.render(ctx, 300, 300);
			
			IT.zoom_img2.render(ctx, 100, 200);
		}
	}
};